/**
 * Framework for batch testing user profile models
 * Final project by Sergey Nepomnyachiy and Julia Polchin
 * Supervisor: Tsvi Kuflik
 *
 */
package models.rafi_tati;

import java.util.Vector;

/**
 * @author Sergey&Julia
 * 
 */
public class TATI {
	private Vector<Category> categories;
	private int stepsCounter;
	private Strategy strategy;

	/**
	 * @param uid
	 */
	public TATI(Integer uid) {
		this.strategy = new Strategy(); // indifferent by default
		this.stepsCounter = 0;
		this.categories = new  Vector<Category>(10);
		for (int i = 0; i < 10; ++i) 
			this.categories.add(new Category());
	}

	/**
	 * 
	 */
	public void doAdaptation() {
		++this.stepsCounter;
	}

	/**
	 * @return
	 */
	public Double predict(Integer categoryIndex) {
		return this.categories.elementAt(categoryIndex).getInterest();
	}

    public void feed(Integer categoryIndex, Integer rating ) {
    	this.categories.elementAt(categoryIndex).learn(rating, this.strategy);
    	doAdaptation();
    }
}
